<template>
    <el-dialog :visible.sync="visible" width="1000px" :append-to-body="true" title="选择商户">
        <div style="height:60vh">
			<merchartTable :astatus="1" :initalSelection="value" ref="merchartTable" @handleselect="handleselect"></merchartTable>
        </div>
        <template #footer>
            <el-button @click="close">取 消</el-button>
            <el-button type="primary" @click="confirm">确 定</el-button>
        </template>
    </el-dialog>
</template>
<script>
// import storeTable from '@/views/assignment/list/index.vue'
import merchartTable from '../views/merchant/list/index.vue'
export default{
    components:{merchartTable},
    data(){
        return{
            visible:false
        }
    },
    props:{
        value:{
            type:Array,
            default:()=>[]
        },
		title:{
			type:String,
			defaulit:''
		}
    },
    methods:{
        open(){
            this.visible = true;
        },
        close(){
            this.visible = false;
			this.$refs.merchartTable.clearSelection();
        },
		handleselect(result){
			console.log(result,'result1')
		},
        confirm(){
			// console.log(this.$refs.merchartTable.selection,'this.$refs.merchartTable.selection')
            this.$emit('input',this.$refs.merchartTable.selection.map(item=>item.id))
            this.$emit('confirm',this.$refs.merchartTable.selection)
            this.close()
        }
    }
}
</script>